<!-- html -->
<template>
  <h2 class="h2">页面标签使用ref</h2>
  <span class="span2" ref="content">hello</span>
  <button class="button1" @click="print">打印</button>
</template>

<!-- js或ts -->
<script lang="ts">
export default {
  name: 'htmlRefTest1'
}
</script>

<!-- js或ts -->
<script setup lang="ts">
import { ref } from 'vue'
//数据
let content = ref()
//方法
function print() {
  console.log('content：', content.value)
}
</script>

<!-- 样式 -->
<style scoped></style>